/**
 * Created by Administrator on 2017/3/10.
 */
var multer = require('multer');

var storage = multer.diskStorage({
    destination:'public/uploads',
    filename:function (req,file,callback) {
        var wcID = req.cookies.wcID;
        var fileformat = (file.originalname).split('.');
        callback(null,file.fieldname+'-'+Date.now()+'.'+fileformat[fileformat.length-1])
    }
});

var upload = multer({storage});

module.exports = upload;